/**
 * Created by wu on 2017/04/09.
 */
module.exports = function ($http, httpservice) {
    var confirmTeamService = {};
    confirmTeamService.resetpassword = function (password, phoneNum, emailNum, token, type,pictureCode,msgCode) {
        //重置密码
        var params = {"password": password, "cellphone": phoneNum, "email": emailNum, "token": token, "type": type,"pictureCode":pictureCode,"msgCode":msgCode};

        return $http(
            {
                url: httpservice.resetpasswordUrl,
                method: 'POST',
                data: params,
                dataType: 'json',
                headers: {'Content-Type': 'application/json'}
            }
        )
            .then(function (response) {
                return response.data;
            })
            .catch(function (response) {
                console.error('resetpassword error', response.status, response.data);
            })
            .finally(function () {

            });
    };

    confirmTeamService.getInviteInfo = function (password, phoneNum, emailNum, token, type) {
        //重置密码
        var params = {"password": password, "cellphone": phoneNum, "email": emailNum, "token": token, "type": type};

        return $http(
            {
              url: httpservice.getInviteInfoUrl,
              method: 'POST',
              data: params,
              dataType: 'json',
              headers: {'Content-Type': 'application/json'}
            }
        )
        .then(function (response) {
            return response.data;
        })
        .catch(function (response) {
            console.error('resetpassword error', response.status, response.data);
        })
        .finally(function () {

        });
    };

    return confirmTeamService;
};
